﻿<Page
    x:Class="Studio77.CartoonLink.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Studio77.FruitLinkLink"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
	<Page.Resources>
		<Style x:Key="MainButtonStyle" TargetType="Button">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="Button">
						<Grid>
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Pressed">
										<Storyboard>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="image">
												<DiscreteObjectKeyFrame KeyTime="0">
													<DiscreteObjectKeyFrame.Value>
														<Visibility>Visible</Visibility>
													</DiscreteObjectKeyFrame.Value>
												</DiscreteObjectKeyFrame>
											</ObjectAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Disabled"/>
									<VisualState x:Name="PointerOver"/>
								</VisualStateGroup>
								<VisualStateGroup x:Name="FocusStates">
									<VisualState x:Name="Focused"/>
									<VisualState x:Name="PointerFocused"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Image Source="Image/btn_normal.png" Stretch="Fill"/>
							<Image x:Name="image" Source="Image/btn_pressed.png" Stretch="Fill" Visibility="Collapsed"/>
							<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ButtonStyleSound" TargetType="Button">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="Button">
						<Grid>
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Pressed"/>
									<VisualState x:Name="Disabled"/>
									<VisualState x:Name="PointerOver"/>
								</VisualStateGroup>
								<VisualStateGroup x:Name="FocusStates">
									<VisualState x:Name="Focused"/>
									<VisualState x:Name="PointerFocused"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Image Source="Image/music_on.png" Stretch="Fill"/>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ButtonStyleSoundMute" TargetType="Button">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="Button">
						<Grid>
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Pressed"/>
									<VisualState x:Name="Disabled"/>
									<VisualState x:Name="PointerOver"/>
								</VisualStateGroup>
								<VisualStateGroup x:Name="FocusStates">
									<VisualState x:Name="Focused"/>
									<VisualState x:Name="PointerFocused"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Image Source="Image/music_off.png" Stretch="Fill"/>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</Page.Resources>

    <Viewbox>

		<Grid Background="#FF8F8F8F" Height="768" Width="1366">
			<Image Margin="0" Source="Image/mainbg.jpg" Stretch="Fill"/>
			<StackPanel HorizontalAlignment="Center" Height="520" VerticalAlignment="Center" Width="410" Margin="478,238,478,10">
				<Button x:Name="btnEasyGame" Content="休闲模式" HorizontalAlignment="Center" Height="88" Style="{StaticResource MainButtonStyle}" VerticalAlignment="Top" Width="300" FontSize="32" Foreground="Black" Margin="0,30,0,0"/>
				<Button x:Name="btnHelp" Content="游戏帮助" HorizontalAlignment="Center" Height="88" Style="{StaticResource MainButtonStyle}" VerticalAlignment="Top" Width="300" FontSize="32" Foreground="Black" Margin="0,30,0,0"/>
				<Button x:Name="btnHardGame" Content="冒险模式" HorizontalAlignment="Center" Height="88" Style="{StaticResource MainButtonStyle}" VerticalAlignment="Top" Width="300" FontSize="32" Foreground="Black" Margin="0,30,0,0"/>
				<Button x:Name="btnExit" Content="退出游戏" HorizontalAlignment="Center" Height="88" Style="{StaticResource MainButtonStyle}" VerticalAlignment="Top" Width="300" FontSize="32" Foreground="Black" Margin="0,30,0,0"/>
			</StackPanel>
			<Button x:Name="btnSound" Content="音效开" Margin="1169,595,69,45" Style="{StaticResource ButtonStyleSound}" FontSize="24" Foreground="Black" Width="128" Height="128"/>
			<Button x:Name="btnSound_Mute" Content="音效关" Margin="1169,595,0,45" Style="{StaticResource ButtonStyleSoundMute}" FontSize="24" Foreground="Black" Width="128" Height="128" Visibility="Collapsed"/>

		</Grid>
	</Viewbox>
</Page>
